<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./Cesium/include-cesium-local.js"></script>
    <script src="./Cesium/include-lib-local.js"></script>
    <script src="./config/ion.js"></script>
  </head>
  <body>
    <div id="GlobeView"></div>
    <script>
      const esri = new Cesium.ArcGisMapServerImageryProvider({
        url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer',
      });
      const viewer = new Cesium.Viewer('GlobeView', {
        imageryProvider: esri,
        //terrainProvider: Cesium.createWorldTerrain(),
      });
      //加载gltf格式数据到cesium
      var scene = viewer.scene;
      var position = Cesium.Transforms.eastNorthUpToFixedFrame(
        Cesium.Cartesian3.fromDegrees(102.858205, 24.873613, 0)
      );

      //gltf数据加载位置
      var model = scene.primitives.add(
        Cesium.Model.fromGltf({
          url: './data/tain.gltf', //如果为bgltf则为.bgltf
          modelMatrix: position,
          scale: 1, //放大倍数
        })
      );

      console.log(model);
      viewer.camera.flyTo({
        destination: Cesium.Cartesian3.fromDegrees(
          102.858205,
          24.873613,
          1000.0
        ),
      });
    </script>
  </body>
</html>
